package com.flyaudio.xiaopengautopilot.center;

import android.app.Application;
import android.content.Intent;
import android.os.Build;

import com.flyaudio.xiaopengautopilot.presenter.IVehicleModule;
import com.flyaudio.xiaopengautopilot.util.FileOpenPatch;
import com.flyaudio.xiaopengautopilot.util.JSONUtil;
import com.flyaudio.xiaopengautopilot.util.L;
import com.flyaudio.xiaopengautopilot.util.LogcatFileManager;

public class MyApplication extends Application {
    private final String TAG = "MyApplication";
    IVehicleModule module;
    @Override
    public void onCreate() {
        super.onCreate();
        module = new IVehicleModule(this);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            startForegroundService(new Intent(this, VehicleService.class));
        } else {
            startService(new Intent(this, VehicleService.class));
        }
//        FileOpenPatch task  = new FileOpenPatch(new FileOpenPatch.TaskCallback() {
//            @Override
//            public void run() {
//                LogcatFileManager.getInstance().start(LogcatFileManager.pathLogcat);
//            }
//        });

        L.d(TAG,"onCreate");
    }

    @Override
    public void onTerminate() {
//        LogcatFileManager.getInstance().stop();
        super.onTerminate();

    }
}
